import request from "@/utils/request";
import { AxiosPromise } from "axios";
import {
  KnowledgeFileQuery,
  KnowledgeFileVO,
  KnowledgeFileForm,
} from "./types";

export function listKnowledgeFile(
  queryParams?: KnowledgeFileQuery
): AxiosPromise<KnowledgeFileVO[]> {
  return request({
    url: "buss/knowledge-file/list",
    method: "get",
    params: queryParams,
  });
}

/**
 * 新增
 *
 * @param data
 */
export function saveKnowledgeFile(data: KnowledgeFileForm) {
  return request({
    url: "buss/knowledge-file/save",
    method: "post",
    data,
  });
}

/**
 * 删除
 */
export function deleteKnowledgeFile(ids: string[]) {
  return request({
    url: "buss/knowledge-file/del",
    method: "post",
    data: ids,
  });
}
